uniform mat4 u_WVP;
uniform mat4 u_W;

attribute vec3 a_pos_local;
attribute vec3 a_norm_local;
attribute vec2 a_uv;

varying vec2 v_uv;
varying vec3 v_norm_world;
varying vec3 v_pos_world;

void main()
{
	vec4 pos = vec4(a_pos_local, 1.0);
	
	gl_Position = u_WVP * pos;
	v_pos_world = (u_W * pos).xyz;
	v_norm_world = normalize((u_W * vec4(a_norm_local, 0.0)).xyz);
	v_uv = a_uv;
}